home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-07-20 | 991 b | 45 lines | [TEXT/CWIE] |
- //Copyright (c) 1997 Aidan Cully
- //All rights reserved
-
- #include "CLWindowDrawer.h"
- #include "CLBaseWindow.h"
- #include "CLApplication.h"
-
- TWindowDrawer::TWindowDrawer( TLayoutBranch *super ):
- TLayoutLeaf( super )
- {
- }
-
- void TWindowDrawer::AttachedToWindow( TBaseWindow *win, Rect r )
- {
- TLayoutLeaf::AttachedToWindow( win, r );
- win->AddDrawer( this );
- }
-
- void TWindowDrawer::DrawSelf( TDrawSlate *d )
- {
- }
-
- void TWindowDrawer::DrawWindow( TBaseWindow *win )
- {
- GrafPtr oldPort;
- GDHandle oldDevice, dev;
- GWorldPtr oldWorld, world;
-
- ::GetGWorld( &oldWorld, &oldDevice );
- TApplication::SCurApp()->GetGlobalWorld( world, dev );
- ::SetGWorld( world, dev );
- ::GetPort( &oldPort );
- ::SetPort( win->GetWindow() );
- RgnHandle clip= ::NewRgn();
- RgnHandle oldClip= ::NewRgn();
- ::GetClip( oldClip );
- GetClip( clip );
- ::SetClip( clip );
- DrawWindowSelf( win );
- ::SetClip( oldClip );
- ::DisposeRgn( oldClip );
- ::DisposeRgn( clip );
- ::SetPort( oldPort );
- ::SetGWorld( oldWorld, oldDevice );
- }